//
//  NSObject+Dispatch.m
//  Xiu
//
//  Created by mayanwei on 14-10-11.
//  Copyright (c) 2014年 CC. All rights reserved.
//

#import "NSObject+Dispatch.h"

@implementation NSObject (Dispatch)

- (void)exGlobalQueue:(void (^)())queue
{
    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), queue);
}

- (void)exMainQueue:(void (^)())queue
{
    dispatch_async(dispatch_get_main_queue(), queue);
}

- (void)exDispatchAfter:(NSTimeInterval)second queue:(void (^)())queue;
{
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(second * NSEC_PER_SEC)), dispatch_get_main_queue(), queue);
}

@end
